<?php

/**
 * AreasTextos
 *  
 * @author diego
 * @version 
 */

require_once 'Zend/Db/Table/Abstract.php';

class AreasTextos extends Zend_Db_Table_Abstract {

	protected $_name = 'tex_areas_textos';
	
    protected $_referenceMap    = array(
        'Texto' => array(
            'columns'           => array('id_texto'),
            'refTableClass'     => 'Textos',
            'refColumns'        => array('id'),
            'onDelete'          => self::CASCADE,
            'onUpdate'          => self::RESTRICT
        ), 
        'Areas' => array(
            'columns'           => array('id_area'),
            'refTableClass'     => 'Areas',
            'refColumns'        => array('id'),
            'onDelete'          => self::CASCADE,
            'onUpdate'          => self::RESTRICT
        )
        
        );
	
    /**
     * 
     * @param int area, int texto
     * @return Zend_Db_Table_Rowset_Abstract
     */
	public function findbyAreaAndTexto($area, $texto) {
		return $this->fetchAll ( $this->getAdapter ()->quoteInto ( 'id_area = ?', $area ). " AND ".
		$this->getAdapter ()->quoteInto ( 'id_texto = ?', $texto ) );
		
	}
	

}
